<template>
	<view class="list">
		
		<view class="border-bottom padding-sm" v-for="(item,index) in list" :key="index" @click="toDetail(item)">
			
			<view class="padding-tb-sm border-bottom text-lg">
				<image class="tag" :src="`/static/images/icons/${getMarketCode(item.allcode)}.png`" mode=""></image>
				<text>{{item.title}}</text>
				<text class="padding-left-sm text-gray">{{item.code}}</text>
			</view>
			<view class="flex flex-wrap text-nomal">
				<view class="col-2">
					<text class="label">买卖类别</text>
					<text :class="item.is_sell==0?'text-red':'text-green'">证券{{item.is_sell==0?'买入':'卖出'}}{{item.buytype==7?'(大宗)':''}}</text>
				</view>
				<view class="col-2">
					<text class="label">当前状态</text>
					<text>挂单</text>
				</view>
				<view class="col-2">
					<text class="label">委托数量</text>
					<text>{{item.number}}</text>
				</view>
				<view class="col-2">
					<text class="label">委托价格</text>
					<text>{{item.buyprice}}</text>
				</view>
			</view>
			
		<!-- 	<view class="padding-tb">
				<tui-button type="theme" :size="28" height="80rpx">取消entrust</tui-button>
			</view> -->
			
		</view>

	</view>
</template>

<script>
import {getMarketCode} from '@/utils/stock.js';
export default {
	props: {
		list: {
			type: Array,
			default: ()=>[]
		},
	},
	data() {
		return {
			
		};
	},
	methods: {
		getMarketCode,
		toDetail(item) {
			uni.navigateTo({
				url:'/pages/shares/entrustDetail?data='+JSON.stringify(item)
			})
		}
	},
};
</script>

<style lang="scss" scoped>
	.col-2{margin-top: 16rpx;}
	.label{
		color: #999;padding-right: 16rpx;
	}
	.tag{width: 36rpx;height: 24rpx;margin-right: 10rpx;}
</style>